//
//  MessageViewController.m
//  JiJinFinance
//
//  Created by 李东晓 on 15/12/7.
//  Copyright © 2015年 LiDongXiao. All rights reserved.
//

#import "MessageViewController.h"
#import "AutonymViewController.h"
#import "CertifiedViewController.h"
#import "FourBarViewController.h"
#import "BankNoViewController.h"
#import "PasswordViewController.h"
@interface MessageViewController ()


@end

@implementation MessageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"个人信息";
    [self.view setBackgroundColor:kGlobalBg];
    
//    [self BackButton];
    
//    UIView * ViewAutonym = [[UIView alloc]initWithFrame:CGRectMake(0, 101, kUIScreenWidth, 40)];
//    [ViewAutonym setBackgroundColor:[UIColor whiteColor]];
//    [self.view addSubview:ViewAutonym];
    
    UIButton * ButtAutonym = [UIButton buttonWithType:UIButtonTypeCustom];
    [ButtAutonym setFrame:CGRectMake(0, 101, kUIScreenWidth, 40)];
    [ButtAutonym setBackgroundColor:[UIColor whiteColor]];
    [ButtAutonym setTitle:@"实名认证" forState:UIControlStateNormal];
    [ButtAutonym setTitleColor:RGBAColor(70, 70, 70, 1) forState:UIControlStateNormal];
    [ButtAutonym.titleLabel setFont:kGlobalFont];
    [ButtAutonym addTarget:self action:@selector(AutonymClick) forControlEvents:UIControlEventTouchUpInside];
    [ButtAutonym setTitleEdgeInsets:UIEdgeInsetsMake(0, -290*D_width, 0 , 0)];
    [self.view addSubview:ButtAutonym];
    
    UIButton * ButtPhone = [UIButton buttonWithType:UIButtonTypeCustom];
    [ButtPhone setFrame:CGRectMake(0, 153, kUIScreenWidth, 40)];
    [ButtPhone setBackgroundColor:[UIColor whiteColor]];
    [ButtPhone setTitle:@"手机号码" forState:UIControlStateNormal];
    [ButtPhone setTitleColor:RGBAColor(70, 70, 70, 1) forState:UIControlStateNormal];
    [ButtPhone.titleLabel setFont:kGlobalFont];
    [ButtPhone addTarget:self action:@selector(PhoneClick) forControlEvents:UIControlEventTouchUpInside];
    [ButtPhone setTitleEdgeInsets:UIEdgeInsetsMake(0, -290*D_width, 0 , 0)];
    [self.view addSubview:ButtPhone];
    
    UIButton * ButtBank = [UIButton buttonWithType:UIButtonTypeCustom];
    [ButtBank setFrame:CGRectMake(0, 207, kUIScreenWidth, 40)];
    [ButtBank setBackgroundColor:[UIColor whiteColor]];
    [ButtBank setTitle:@"银行卡" forState:UIControlStateNormal];
    [ButtBank setTitleColor:RGBAColor(70, 70, 70, 1) forState:UIControlStateNormal];
    [ButtBank.titleLabel setFont:kGlobalFont];
    [ButtBank addTarget:self action:@selector(BankClick) forControlEvents:UIControlEventTouchUpInside];
    [ButtBank setTitleEdgeInsets:UIEdgeInsetsMake(0, -290*D_width, 0 , 0)];
    [self.view addSubview:ButtBank];
    
    UIButton * ButtLoginCode = [UIButton buttonWithType:UIButtonTypeCustom];
    [ButtLoginCode setFrame:CGRectMake(0, 260, kUIScreenWidth, 40)];
    [ButtLoginCode setBackgroundColor:[UIColor whiteColor]];
    [ButtLoginCode setTitle:@"登录密码" forState:UIControlStateNormal];
    [ButtLoginCode setTitleColor:RGBAColor(70, 70, 70, 1) forState:UIControlStateNormal];
    [ButtLoginCode.titleLabel setFont:kGlobalFont];
    [ButtLoginCode addTarget:self action:@selector(LoginCodeClick) forControlEvents:UIControlEventTouchUpInside];
    [ButtLoginCode setTitleEdgeInsets:UIEdgeInsetsMake(0, -290*D_width, 0 , 0)];
    [self.view addSubview:ButtLoginCode];
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    
     _LabAutonym = [[UILabel alloc]initWithFrame:CGRectMake(310*D_width, 15, 50, 12)];
    [_LabAutonym setFont:kGlobalTintFont];
    
    
    [_LabAutonym setText:self.StrName];
    
    
    [_LabAutonym setTextAlignment:NSTextAlignmentCenter];
    [_LabAutonym setTextColor:[UIColor blackColor]];
    [ButtAutonym addSubview:_LabAutonym];
    
     _LabPhone = [[UILabel alloc]initWithFrame:CGRectMake(255*D_width, 15, 120, 12)];
    [_LabPhone setFont:kGlobalTintFont];
    [_LabPhone setText:@"15868813334"];
    [_LabPhone setTextAlignment:NSTextAlignmentCenter];
    [_LabPhone setTextColor:[UIColor blackColor]];
    [ButtPhone addSubview:_LabPhone];
    
     _LabBank = [[UILabel alloc]initWithFrame:CGRectMake(300*D_width, 15, 50, 12)];
    [_LabBank setFont:kGlobalTintFont];
    [_LabBank setText:@"未绑定"];
    [_LabBank setTextAlignment:NSTextAlignmentCenter];
    [_LabBank setTextColor:[UIColor blackColor]];
    [ButtBank addSubview:_LabBank];
    
     _LabLoginCode = [[UILabel alloc]initWithFrame:CGRectMake(305*D_width, 15, 50, 12)];
    [_LabLoginCode setFont:kGlobalTintFont];
    [_LabLoginCode setText:@"修改"];
    [_LabLoginCode setTextAlignment:NSTextAlignmentCenter];
    [_LabLoginCode setTextColor:[UIColor blackColor]];
    [ButtLoginCode addSubview:_LabLoginCode];
    
    UIImageView * BankImage = [[UIImageView alloc]initWithFrame:CGRectMake(350*D_width, 17, 5, 9)];
    
    [BankImage setImage:[UIImage imageNamed:@"mycount_11"]];
    
    [ButtBank addSubview:BankImage];
    
    UIImageView * LoginCodeImage = [[UIImageView alloc]initWithFrame:CGRectMake(350*D_width, 17, 5, 9)];
    
    [LoginCodeImage setImage:[UIImage imageNamed:@"mycount_11"]];
    
    [ButtLoginCode addSubview:LoginCodeImage];
}


//#pragma 返回按钮
//-(void)BackButton
//{
//    UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
//    [button setFrame:CGRectMake(0, 0,13,20)];
//    
//    [button setBackgroundColor:[UIColor clearColor]];
//    
//    [button setImage:[UIImage imageNamed:@"navigation_back"] forState:UIControlStateNormal];
//    
//    [button addTarget:self action:@selector(BackClick) forControlEvents:UIControlEventTouchUpInside];
//    
//    UIBarButtonItem * barbutton = [[UIBarButtonItem alloc]initWithCustomView:button];
//    
//    self.navigationItem.leftBarButtonItem = barbutton;
//    
//}
//#pragma 返回按钮的点击方法
//-(void)BackClick
//{
//    FourBarViewController * record = [[FourBarViewController alloc]init];
//    [self.navigationController pushViewController:record animated:NO];
//}




-(void)AutonymClick
{
    NSLog(@"实名认证");
    //判断是否有名字如果没有跳到编辑页面编写，如果有跳转到已认证页面。
    if (self.StrName == nil) {
        
        AutonymViewController * autonym = [[AutonymViewController alloc]init];
        [self.navigationController pushViewController:autonym animated:YES];
    }
//    }else
//    {
//        CertifiedViewController * certified = [[CertifiedViewController alloc]init];
//        
//        certified.StrName = _LabAutonym.text;
//        
//        [self.navigationController pushViewController:certified animated:YES];
//    }
    
    
}
-(void)PhoneClick
{
    NSLog(@"手机号码");
}
-(void)BankClick
{
    NSLog(@"银行卡");
    BankNOViewController * bound = [[BankNOViewController alloc]init];
    [self.navigationController pushViewController:bound animated:YES];
    
}
-(void)LoginCodeClick
{
    NSLog(@"登录密码");
    PasswordViewController * password = [[PasswordViewController alloc]init];
    [self.navigationController pushViewController:password animated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
